home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / cpptask1.zip / BUILTINS.MAK next >
Text File  |  1991-01-27  |  9KB  |  327 lines

  1. #**********************************************************************
  2. #
  3. #   builtins.mak - "built-in" rules for Borland MAKE utility
  4. #
  5. #   12/??/90    J. Alan Eldridge    created for TC 2.0
  6. #
  7. #   07/24/90    JAE                 revised heavily for TC++ 1.0
  8. #
  9. #   11/07/90    JAE                 cleaned up a bit
  10. #                                   now uses $(TC*) environment variables
  11. #                                   to find TC++ files
  12. #
  13. #   12/20/90    JAE                 modified to use a TCC configuration
  14. #                                   file for default options
  15. #
  16. #                                   removed some superfluous options
  17. #
  18. #**********************************************************************
  19.  
  20. #   force .h file dependency checking
  21.  
  22. .AUTODEPEND
  23.  
  24. #**********************************************************************
  25. #
  26. #   the following symbols are defined to locate the Turbo C++
  27. #   executables, include files, libraries, etc.
  28. #
  29. #   name        meaning                         example
  30. #   ------------------------------------------------------------
  31. #
  32. #   TCDIR       drive & dir for tc files        D:\TC
  33. #
  34. #   TCINC       full include dir path           D:\TC\INCLUDE
  35. #
  36. #   TCLIB       full library dir path           D:\TC\LIB
  37. #
  38. #   TAINC       full include path for asm       D:\TASM\EX
  39. #
  40. #**********************************************************************
  41.  
  42.  
  43. #**********************************************************************
  44. #
  45. #   the following symbols can be defined to affect the C++ compiler,
  46. #   assembler, and linker options:
  47. #
  48. #   define these for effect (no value necessary):
  49. #
  50. #       SMALL, MEDIUM, COMPACT, or HUGE
  51. #           these override default LARGE memory model
  52. #
  53. #   define these = 1 or = 0 to control options:
  54. #
  55. #       name        meaning                     default
  56. #       --------------------------------------------------
  57. #
  58. #       NODBG       turn off generation         0
  59. #                   of debug info in objs
  60. #
  61. #       NOSYM       no symbol table in exe      0
  62. #
  63. #       I286        use 186/286 instructions    0
  64. #
  65. #       F87         87-only floating point      0
  66. #
  67. #       F287        287-only floating point     0
  68. #
  69. #       ALIGN       word align structures       0
  70. #
  71. #       WILDARGS    auto *? expand in main()    0
  72. #
  73. #       OVERLAY     link with overlay lib       0
  74. #
  75. #       TCLASS      link with TC++ class lib    0
  76. #
  77. #       GRAPHICS    link with BGI graphics      0
  78. #
  79. #       NOFLOAT     do not link with math lib   0
  80. #
  81. #**********************************************************************
  82.  
  83. #**********************************************************************
  84. #
  85. #   the following symbols are defined for use by the
  86. #   applications makefile:
  87. #
  88. #   MEM,CMEM        a single letter representing the C++
  89. #                   compiler memory model (S,C,M,L,H)
  90. #
  91. #**********************************************************************
  92.  
  93. #**********************************************************************
  94. # set the memory model if not already specified
  95. #**********************************************************************
  96.  
  97. !if $(SMALL) || $(small)
  98. CMEM=s
  99. AMEM=__SMALL__
  100.  
  101. !elif $(MEDIUM) || $(medium)
  102. CMEM=m
  103. AMEM=__MEDIUM__
  104.  
  105. !elif $(COMPACT) || $(compact)
  106. CMEM=c
  107. AMEM=__COMPACT__
  108.  
  109. !elif $(HUGE) || $(huge)
  110. CMEM=h
  111. AMEM=__HUGE__
  112.  
  113. !else
  114. CMEM=l
  115. AMEM=__LARGE__
  116. !endif
  117.  
  118. MEM=$(CMEM)
  119.  
  120. #**********************************************************************
  121. #   start ASM,CC flags with memory model
  122. #**********************************************************************
  123.  
  124. CCFLAGS=-m$(CMEM)
  125. ASFLAGS=/d$(AMEM)
  126.  
  127. #**********************************************************************
  128. # debug info defaults to on
  129. #**********************************************************************
  130.  
  131. !if $(NODBG)
  132. NOSYM=1
  133. !else
  134. CCFLAGS=$(CCFLAGS) -v
  135. !endif
  136.  
  137. #**********************************************************************
  138. # tell where to find include files
  139. #**********************************************************************
  140.  
  141. #   INC1 ... INC3 are for app use
  142.  
  143. !if $d(INC1)
  144. CCFLAGS=-I$(INC1) $(CCFLAGS)
  145. ASFLAGS=/i$(INC1) $(ASFLAGS)
  146. !endif
  147.  
  148. !if $d(INC2)
  149. CCFLAGS=-I$(INC2) $(CCFLAGS)
  150. ASFLAGS=/i$(INC2) $(ASFLAGS)
  151. !endif
  152.  
  153. !if $d(INC3)
  154. CCFLAGS=-I$(INC3) $(CCFLAGS)
  155. ASFLAGS=/i$(INC3) $(ASFLAGS)
  156. !endif
  157.  
  158. #**********************************************************************
  159. # do we want 8087-only fp support?
  160. #**********************************************************************
  161.  
  162. !if $(F87)
  163. CCFLAGS=$(CCFLAGS) -f87
  164. !elif $(F287)
  165. CCFLAGS=$(CCFLAGS) -f287
  166. !endif
  167.  
  168. #**********************************************************************
  169. # 186/286 instructions
  170. #**********************************************************************
  171.  
  172. !if $(I286)
  173. CCFLAGS=$(CCFLAGS) -1
  174. !endif
  175.  
  176. #**********************************************************************
  177. # structure alignment (default is off)
  178. #**********************************************************************
  179.  
  180. !if $(ALIGN)
  181. CCFLAGS=$(CCFLAGS) -a
  182. !endif
  183.  
  184. #**********************************************************************
  185. # miscellaneous flags the user might want
  186. #**********************************************************************
  187.  
  188. !if $d(CFLAGS)
  189. CCFLAGS=$(CCFLAGS) $(CFLAGS)
  190. !endif
  191.  
  192. #**********************************************************************
  193. # this command runs the compiler
  194. #**********************************************************************
  195.  
  196. TCC=bcc $(CCFLAGS)
  197.  
  198. #**********************************************************************
  199. # here's how to compile a .c (or .cpp) to get a .obj file or a .asm file
  200. #**********************************************************************
  201.  
  202. .c.obj:
  203.     $(TCC) {$. }
  204.  
  205. .cpp.obj:
  206.     $(TCC) {$. }
  207.  
  208. .c.asm:
  209.     $(TCC) -S {$. }
  210.  
  211. .cpp.asm:
  212.     $(TCC) -S {$. }
  213.  
  214.  
  215. #**********************************************************************
  216. # the assembler include files are here
  217. #**********************************************************************
  218.  
  219. ASFLAGS=$(ASFLAGS) /i$(TAINC)
  220.  
  221. #**********************************************************************
  222. # miscellaneous flags the user might want
  223. #**********************************************************************
  224.  
  225. !if $d(AFLAGS)
  226. ASFLAGS=$(ASFLAGS) $(AFLAGS)
  227. !endif
  228.  
  229. #**********************************************************************
  230. # this command runs the assembler
  231. #**********************************************************************
  232.  
  233. ASFLAGS=$(ASFLAGS) /zi /mx /m3 /jMASM51
  234.  
  235. TASM=tasm $(ASFLAGS)
  236.  
  237. #**********************************************************************
  238. # here's how to assemble a .asm to get a .obj file
  239. #**********************************************************************
  240.  
  241.  
  242. .asm.obj:
  243.     $(TASM) $&,$*
  244.  
  245. .asm.lst:
  246.     $(TASM) /l $&,nul
  247.  
  248. #**********************************************************************
  249. #   macro to run the librarian
  250. #**********************************************************************
  251.  
  252. TLIB=tlib /C $*.lib
  253.  
  254. #**********************************************************************
  255. # linker debugging option
  256. #**********************************************************************
  257.  
  258. !if $(NOSYM)
  259. LDBG=
  260. !else
  261. LDBG=/v
  262. !endif
  263.  
  264. #**********************************************************************
  265. # macro for location of tc libraries
  266. #**********************************************************************
  267.  
  268. !if !$d(TCLIB)
  269. TCLIB=$(TCDIR)\lib
  270. !endif
  271.  
  272. #**********************************************************************
  273. # macros for full pathnames of compiler libraries
  274. #
  275. # if NOFLOAT is defined, then math libs will not be searched (unless
  276. #   F87 or F287 are defined, which override NOFLOAT)
  277. # if GRAFIX is defined, the graphics library will be searched
  278. # if TCLASS is defined, the TC++ class libraries will be searched
  279. # if OVERLAY is defined, the overlay support lib will be searched
  280. #
  281. #**********************************************************************
  282.  
  283. TCLIBS=
  284.  
  285. CSTARTUP=$(TCLIB)\c0$(CMEM)
  286.  
  287. !if $(WILDARGS)
  288. CSTA